import http from "@/http";
import { BudgetSheet, BudgetSheetQuery, BudgetSheetCreateDTO, BudgetSheetUpdateDTO, HistoricalBudgetSheetSaveDTO } from './type';

// 分页查询预算单列表
export const getBudgetSheetListApi = (params: BudgetSheetQuery) => {
  return http.get("/budgetSheet/queryBudgetSheetList", params);
};

// 根据ID获取预算单详情
export const getBudgetSheetDetailApi = (id: number | string) => {
  return http.get(`/budgetSheet/getBudgetSheetDetail/${id}`);
};

// 根据ID获取预算单详情
export const getBudgetSheetDetailAllApi = (id: number | string) => {
  return http.get(`/budgetSheet/getBudgetSheetDetailAll/${id}`);
};

// 新增预算单
export const addBudgetSheetApi = (data: BudgetSheetCreateDTO) => {
  return http.post("/budgetSheet/addBudgetSheet", data);
};

// 更新预算单
export const updateBudgetSheetApi = (data: BudgetSheetUpdateDTO) => {
  return http.put("/budgetSheet/updateBudgetSheet", data);
};

// 删除预算单
export const deleteBudgetSheetApi = (id: number | string) => {
  return http.delete(`/budgetSheet/deleteBudgetSheet/${id}`);
};

// 保存历史预算单
export const saveHistoricalBudgetSheetApi = (data: HistoricalBudgetSheetSaveDTO) => {
  return http.post("/historicalQuotation/saveHistoricalBudgetSheet", data);
}; 